<html>

<head>
	<meta charset="UTF-8">
	<title>Registar Giveaway</title>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/style.css');?>">
	<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
	<link href='http://fonts.googleapis.com/css?family=Raleway:300' rel='stylesheet' type='text/css'>
	<link href="<?php echo base_url('css/ui-lightness/jquery-ui-1.10.4.custom.min.css');?>" rel="stylesheet">
	<script src="<?php echo base_url('js/jquery-1.10.2.js');?>"></script>
	<script src="<?php echo base_url('js/jquery-ui-1.10.4.custom.min.js');?>"></script>
	<script src="<?php echo base_url('js/jquery-ui-timepicker-addon.js');?>"></script>
	<script>
	$(function() {
		
		$( ".datepicker" ).datetimepicker({
			dateFormat: "yy-mm-dd"
		});

	});
	</script>
</head>


<body>

	<div class="header">
		<div id="wrapper">
			<div class="logo">
				<h1><a href="<?php echo base_url('/giveaways');?>">GIVEAWAYS</a></h1>
			</div>
			<div class="benvindo">Olá <?php echo $u_nome?></div>
			<div class="dropdown"> <span class="dropdown-toggle" tabindex="0"></span>
			  <div class="dropdown-text"></div>
			  <ul class="dropdown-content">
			    <li><a href="<?php echo base_url('/giveaways/editar_user');?>">Perfil</a></li>
			    <li><a href="<?php echo base_url('/giveaways/pesquisaGiveawaysUser');?>">Giveaways</a></li>
			    <li><a href="<?php echo base_url('/giveaways/logout');?>">Logout </a></li>
			  </ul>
			</div>
			<form method="post" action="<?php echo base_url('/giveaways/criar_giveaway');?>">
				<input name="add" id="add" value="" type="submit"/>
			</form>
		</div>
	</div>

	<div class="body">
			<div class="middle-registar">
				<div id="wrapper">
					<div class="registo">GIVEAWAY</div>
					<div class="form2">
						<?php 
							$this->load->helper("form");
							echo form_open_multipart('/giveaways/registarbtn_giveaway');

							echo form_label("Tipo","tipo");
							$data = array (
								'Livro' => 'Livro',
								'Música' => 'Música',
								'Filme' => 'Filme'
							);
							echo form_dropdown('tipo',$data, $tipo);

							echo form_label("Título","titulo");
							$data = array (
								"name" => "titulo",
								"id" => "titulo",
								"value" => "$titulo",
								"required" => "required",
								"maxlength"   => "70",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Data Início","datepicker");
							$data = array (
								"name" => "datepicker",
								"class" => "datepicker",
								"value" => "$datepicker",
								"required" => "required",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Data Fim","datepicker2");
							$data = array (
								"name" => "datepicker2",
								"class" => "datepicker",
								"value" => "$datepicker2",
								"required" => "required",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Descrição","descricao");
							$data = array (
								"name" => "descricao",
								"id" => "descricao",
								"value" => "$descricao",
								"type" => "textarea",
								"rows" => 5,
								"maxlength"   => "1000"
							);
							echo form_textarea($data);

							echo form_label("Nº Cópias","n_copias");
							$data = array (
								"name" => "n_copias",
								"id" => "n_copias",
								"value" => "$n_copias",
								"required" => "required",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Imagem","imagem");
							$data = array (
								"name" => "userfile",
								"id" => "file",
								"type" => "file"
							);
							echo form_upload($data);
	 
	 						echo form_submit(array("name" => "registarbtn_giveaway"), "Registar");

							echo form_close(); 

						?>
					</div>
				</div>
			</div>
	</div>

</body>
<script type="text/javascript"> 
	alert ('<?php echo $feedback?>');
</script>
</html>